package com.imooc.pojo;

import com.baomidou.mybatisplus.annotation.*;
import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.ToString;

/**
 * 用户表 
 * 
 * @author yukangkang
 * @email 1304473884@qq.com
 * @date 2021-01-16 21:20:11
 */
@Data
@ToString
@TableName("users")
public class Users implements Serializable {
	private static final long serialVersionUID = 1L;

		/**
		 * 主键id 用户id
		 */
		@TableId(value = ID, type = IdType.AUTO)
		private String id;
		/**
		 * 用户名 用户名
		 */
		@TableField(USERNAME)
		private String username;
		/**
		 * 密码 密码
		 */
		@TableField(PASSWORD)
		private String password;
		/**
		 * 昵称 昵称
		 */
		@TableField(NICKNAME)
		private String nickname;
		/**
		 * 真实姓名
		 */
		@TableField(REALNAME)
		private String realname;
		/**
		 * 头像
		 */
		@TableField(FACE)
		private String face;
		/**
		 * 手机号 手机号
		 */
		@TableField(MOBILE)
		private String mobile;
		/**
		 * 邮箱地址 邮箱地址
		 */
		@TableField(EMAIL)
		private String email;
		/**
		 * 性别 性别 1:男  0:女  2:保密
		 */
		@TableField(SEX)
		private Integer sex;
		/**
		 * 生日 生日
		 */
		@TableField(BIRTHDAY)
		private Date birthday;
		/**
		 * 创建时间 创建时间
		 */
		@TableField(CREATED_TIME)
		private Date createdTime;
		/**
		 * 更新时间 更新时间
		 */
		@TableField(UPDATED_TIME)
		private Date updatedTime;




	public final static String ID =  "`id`";
	public final static String USERNAME =  "`username`";
	public final static String PASSWORD =  "`password`";
	public final static String NICKNAME =  "`nickname`";
	public final static String REALNAME =  "`realname`";
	public final static String FACE =  "`face`";
	public final static String MOBILE =  "`mobile`";
	public final static String EMAIL =  "`email`";
	public final static String SEX =  "`sex`";
	public final static String BIRTHDAY =  "`birthday`";
	public final static String CREATED_TIME =  "`created_time`";
	public final static String UPDATED_TIME =  "`updated_time`";


	public final static String ID_COMMENT =  "主键id 用户id";
	public final static String USERNAME_COMMENT =  "用户名 用户名";
	public final static String PASSWORD_COMMENT =  "密码 密码";
	public final static String NICKNAME_COMMENT =  "昵称 昵称";
	public final static String REALNAME_COMMENT =  "真实姓名";
	public final static String FACE_COMMENT =  "头像";
	public final static String MOBILE_COMMENT =  "手机号 手机号";
	public final static String EMAIL_COMMENT =  "邮箱地址 邮箱地址";
	public final static String SEX_COMMENT =  "性别 性别 1:男  0:女  2:保密";
	public final static String BIRTHDAY_COMMENT =  "生日 生日";
	public final static String CREATED_TIME_COMMENT =  "创建时间 创建时间";
	public final static String UPDATED_TIME_COMMENT =  "更新时间 更新时间";


	public static Users of(Object obj) {
		Users e = new Users();
		BeanUtils.copyProperties(obj, e);
		return e;
	}

	public static QueryWrapper<Users> queryWrapper(Object obj) {
		return new QueryWrapper<>(of(obj));
	}



}
